import {
	computed
} from 'vue'
import {
	request,
	retryableRequest
} from '@/common/request';
import {
	useUserStore
} from '@/stores/user.js'
const userType = computed(() => {
	return useUserStore().userType == 2 ? "b-agent-app/app" : "b-merchant-app/app"
})

export const agentApi = {
	/**
	 * 分页查询代理商
	 */
	page: (data) => {
		return request({
			url: `/${userType.value}/agent/page`,
			data
		})
	},
	/**
	 * 查询代理商详情
	 */
	findId: (data) => {
		return request({
			url: `/${userType.value}/agent/find_id`,
			data
		})
	},
	/**
	 * 代理数据
	 */
	getOverview: (data) => {
		return request({
			url: `/${userType.value}/agent/getOverview`,
			data
		})
	},
	/**
	 * 自有商户数据
	 */
	getMerchantOverview: (data) => {
		return request({
			url: `/${userType.value}/agent/getMerchantOverview`,
			data
		})
	},
	// 业务员查代理商列表
	pageByExhibition: (data) => {
		return request({
			url: `/${userType.value}/agent/pageByExhibition`,
			data
		})
	}
}